package com.redbox.RedboxManagment.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.redbox.RedboxManagment.dao.IClient;
import com.redbox.RedboxManagment.ejb.Client;
import com.redbox.RedboxManagment.ejb.OrderStatus;

@Service
public class ClientServiceImp implements IClientService {

	@Autowired
	private IClient clientDao;
	
	@Override
	public List<Client> retrieveAllClients(){
		List<Client> result = clientDao.findAll();
		return result;
	}
	
	@Override
	public Client retrieveClient(int pId) {
		Client result = clientDao.findById(pId);
		return result;
	}

	@Override
	public Client createClient(Client pclient) {
		Client result = clientDao.persistOnMerge(pclient);
		return result;
	}

}
